package com.mlink.ai.chat.bean

import android.os.Parcel
import android.os.Parcelable

data class ExploreCategory(val id: Long, var categoryName: String? = null, var isCustom: Boolean = false) : Parcelable {
    var subCategories: List<ExploreSubCategory> = ArrayList()
    var categoryEventName = categoryName

    constructor(parcel: Parcel) : this(
        parcel.readLong(),
        parcel.readString(),
        parcel.readByte() != 0.toByte()
    )

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeLong(id)
        parcel.writeString(categoryName)
        parcel.writeByte(if (isCustom) 1 else 0)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<ExploreCategory> {
        override fun createFromParcel(parcel: Parcel): ExploreCategory {
            return ExploreCategory(parcel)
        }

        override fun newArray(size: Int): Array<ExploreCategory?> {
            return arrayOfNulls(size)
        }
    }
}

data class ExploreSubCategory(
    var id: Long,
    var categoryName: String,
    var desc: String = "",
    var prompt: String = "",
    var isCustom: Boolean = false,
    var parentCategoryId: Long = 0L,
    var categoryEventName: String = categoryName,
    var emoji: String = ""
)